package com.toggery.POS.service;

import com.toggery.POS.dao.UserMapper;
import com.toggery.POS.tool.PasswordUtil;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginService {
    @Autowired
    UserMapper mapper;

    public boolean loginValidate(String username, String password){
        String sqlPassword = PasswordUtil.getPassword(username,password);
        if((mapper.findById(username).getPassword()).equals(sqlPassword)){
            return true;
        }
        else{
            return false;
        }
    }
}
